package game.leon.war.game;

import game.leon.engine.net.GameSession;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * User: bianpeng
 * Date: 12-1-31
 */
@Component
public class UserSessionService {
    private Map<Long, GameSession> sessionMap = new HashMap<Long, GameSession>();
    public void put(long userId, GameSession session) {
        sessionMap.put(userId, session);
    }
    public GameSession get(long userId) {
        return sessionMap.get(userId);
    }
    public void del(long userId) {
        sessionMap.remove(userId);
    }
}
